package com.jd.demo.jdk8.util;

import com.alibaba.fastjson.JSON;
import com.jd.demo.jdk8.domain.Phone;
import com.jd.demo.jdk8.domain.SkuBaseInfo;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class MyUtil {
    /**
     * 日志
     */
    private static final Logger logger = LogManager.getLogger(MyUtil.class);
    
    public static List<SkuBaseInfo> getSkuList() {
        List<SkuBaseInfo> skuList = new ArrayList<SkuBaseInfo>();
        //租户-JD01，货主-HX01
        skuList.add(new SkuBaseInfo("JD01", "Apple X", "苹果手机-X", "HX0101", "Apple", 8888.0));
        skuList.add(new SkuBaseInfo("JD01", "Apple 8", "苹果手机-8", "HX0101", "Apple", 6088.0));
        skuList.add(new SkuBaseInfo("JD01", "Apple 8 Plus", "苹果手机-8P", "HX0101", "Apple", 6388.0));
        skuList.add(new SkuBaseInfo("JD01", "Mate 10", "苹果手机-8P", "HX0101", "Apple", 6388.0));
        //租户-JD01，货主-HX02
        skuList.add(new SkuBaseInfo("JD01", "Apple X", "苹果手机-X", "HX0102", "Apple", 8688.0));
        skuList.add(new SkuBaseInfo("JD01", "Apple 8", "苹果手机-8", "HX0102", "Apple", 6088.0));
        //租户-JD01，货主-HX03
        skuList.add(new SkuBaseInfo("JD01", "Apple 8 Plus", "苹果手机-8P", "HX0103", "Apple", 6288.0));
        
        //租户-JD02，货主-HX0201
        skuList.add(new SkuBaseInfo("JD02", "Smartisan Pro 2", "锤子手机坚果Pro2", "HX0201", "Smartisan", 2099.0));
        skuList.add(new SkuBaseInfo("JD02", "Apple 8 Plus", "苹果手机-X", "HX0201", "Apple", 8688.0));
        skuList.add(new SkuBaseInfo("JD02", "Huawei Mate10", "华为手机-Mate10", "HX0201", "Huawei", 4288.0));
        skuList.add(new SkuBaseInfo("JD02", "Huawei Mate9", "华为手机-Mate10", "HX0201", "Huawei", 3088.0));
        
        //租户-JD03，货主-HX0201
        skuList.add(new SkuBaseInfo("JD03", "Apple X", "苹果手机-X", "HX0301", "Apple", 8788.0));
        return skuList;
    }
    
    public static List<String> getStringList() {
        List<String> stringList = new ArrayList<String>();
        stringList.add("apple");
        stringList.add("samsung");
        stringList.add("oppo");
        stringList.add("vivo");
        stringList.add("huawei");
        stringList.add("meizu");
        stringList.add("smartisan");
        stringList.add("zhongxing");
        return stringList;
    }
    
    public static List<Integer> getNumList() {
        return Arrays.asList(26, 33, 44, 55, 68, 78, 22, 44, 99, 12, 21, 86);
    }
    
    public static List<Phone> getPhoneList(){
        List<Phone> phoneList = new ArrayList<>();
        phoneList.add(new Phone("appleX","jd", 8666));
        phoneList.add(new Phone("appleX","taobao", 8788));
        phoneList.add(new Phone("appleX","tmall", 8888));
        phoneList.add(new Phone("apple8","jd", 6088));
        phoneList.add(new Phone("apple8","tmall", 6188));
        phoneList.add(new Phone("apple8","suning", 6088));
        phoneList.add(new Phone("mate10","jd", 6088));
        phoneList.add(new Phone("mate10","suning", 6088));
        phoneList.add(new Phone("pro2","jd", 1888));
        phoneList.add(new Phone("pro2","yihaodian", 1888));
        phoneList.add(new Phone("pro2","yihaodian", 1889));
        
        return phoneList;
    }
    
    public static void main(String[] args) {
        List<String> stringList = MyUtil.getStringList();
        logger.debug(JSON.toJSONString(stringList));
    }
}
